/*
 * BuildingUnit.hpp
 *
 *  Created on: 2013-1-14
 *      Author: heqiu
 */

#ifndef BUILDINGUNIT_HPP_
#define BUILDINGUNIT_HPP_
/*
 * 建筑物体有id 取值 [1,1000000]
 * 路没有id。一个点，就是一条路。必须相邻的路，才能行走。
 * 路的id取值
 * [1000001-1000010]
 */

//定义路的id
typedef enum {
	B_WAY_1 = 1000001, //土路
	B_WAY_2 = 1000002, //砖路
	B_WAY_3 = 1000003 //高速路
} WayType;

class BuildingUnit {
public:
	static bool isWay(uint32_t uiId) {
		if (uiId >= 1000001 && uiId <= 1000010) {
			return true;
		}
		return false;
	}
	static uint32_t getWayId(uint32_t uiType) {
		if (uiType == 2) {
			return B_WAY_2;
		}
		if (uiType == 3) {
			return B_WAY_3;
		}
		return B_WAY_1;
	}
	BuildingUnit() {
		m_xLen = 0;
		m_yLen = 0;
		m_iId = 0;
		m_iType = 0;
	}
	void init(uint32_t uiXLen, uint32_t uiYLen) {
		m_xLen = uiXLen;
		m_yLen = uiYLen;
	}
	MyPoint m_pPos;
	uint32_t m_xLen;
	uint32_t m_yLen;
	uint32_t m_iId;	//建筑标号
	uint32_t m_iType;	//建筑类别
};

#endif /* BUILDINGUNIT_HPP_ */
